if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_PayIns_Driver]') and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[PayIn] DROP CONSTRAINT FK_PayIns_Driver
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Driver]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Driver]
GO

CREATE TABLE [dbo].[Driver] (
	[DriverId] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[FirstName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[LastName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[Street1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Street2] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Suburb] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[State] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Postcode] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Phone] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Mobile1] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Mobile2] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Licience] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DriverLicienceExpiry] [datetime] NULL ,
	[TaxiLicience] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ABN] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[DateOfBirth] [datetime] NULL ,
	[CommencementDate] [datetime] NULL ,
	[Nickname] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[TaxiLicienceExpiry] [datetime] NULL ,
	[ETagNumber] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[ETagAccount] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Active] [bit] NULL ,
	[Gender] [int] NULL 
) ON [PRIMARY]
GO

